.block.block-themed.animated.fadeIn
  .block-header.bg-primary
    ul.block-options
      li
        a data-placement="left" data-toggle="tooltip" href="/login" title="直接登陆"
          i.si.si-login
    h3.block-title 忘记密码
  .block-content.block-content-full.block-content-narrow
    /! Reminder Title
    h1.h2.font-w600.push-30-t.push-5 重置密码
    p 请输入您注册的手机号，并输入收到的验证码以重置您的密码
    form.js-validation-reminder.form-horizontal.push-30-t.push-50 action="/forgot" method="post" data-remote='true'
      .form-group
        .col-xs-8
          .form-material.form-material-primary.floating
            input#reminder-mobile.form-control.code-mobile name="mobile" /
            label for="reminder-mobile"  手机号
        .col-xs-4
          = button_tag '获取验证码',  class: 'btn btn-default get_code', data: {code_type: 2}
      .form-group
        .col-xs-12
          .form-material.form-material-primary.floating
            input#reminder-code.form-control name="code" /
            label for="reminder-code"  验证码
      .form-group
        .col-xs-12
          .form-material.form-material-primary.floating
            input#reminder-password.form-control name="password" type='password' /
            label for="reminder-password"  新密码
      .form-group
        .col-xs-12
          .form-material.form-material-primary.floating
            input#reminder-password2.form-control name="password2" type='password' /
            label for="reminder-password2"  重复新密码
      .form-group
        .col-xs-12.col-sm-6.col-md-5
          button.btn.btn-block.btn-primary type="submit"
            i.si.si-envelope-open.pull-right
            | 提交
javascript:
  jQuery('.js-validation-reminder').validate({
    errorClass: 'help-block text-right animated fadeInDown',
    errorElement: 'div',
    errorPlacement: function (error, e) {
      jQuery(e).parents('.form-group > div').append(error);
    },
    highlight: function (e) {
      jQuery(e).closest('.form-group').removeClass('has-error').addClass('has-error');
      jQuery(e).closest('.help-block').remove();
    },
    success: function (e) {
      jQuery(e).closest('.form-group').removeClass('has-error');
      jQuery(e).closest('.help-block').remove();
    },
    rules: {
      'mobile': {
        required: true,
        rangelength: [11, 11]
      },
      'code': {
        required: true,
        rangelength: [4, 4],
        remote: {
          url: "/validate_code",
          type: "put",
          data: {mobile: function(){ return $('#reminder-mobile').val()}, type: 2}
        }
      },
      'password': {
        required: true,
        minlength: 5
      },
      'password2': {
        required: true,
        equalTo: '#reminder-password'
      }
    },
    messages: {
      'mobile': {
        required: '请输入您的手机号',
        rangelength: '请输入正确的手机号'
      },
      'code': {
        required: '请输入您收到的验证码',
        rangelength: '请输入您收到的4位验证码',
        remote: '您输入的验证码不正确！'
      },
      'password': {
        required: '请输入您的新密码',
        minlength: '密码长度不能少于5位'
      },
      'password2': {
        required: '请重复输入您的新密码',
        equalTo: '请输入跟上面一致的密码'
      }
    }
  });